package day05;

import java.util.Scanner;

public class Work1 {
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		String username = new String();
		String password = new String();
		while(true) {
			System.out.println("**************\n1.注册\n2.登录\n3.退出\n**************\n请选择");
			int x = sc.nextInt();
			switch(x) {
			case 1:
				System.out.println("请输入用户名");
				username = sc .next();
				System.out.println("请输入密码");
				password = sc .next();
				System.out.println("注册成功");
				break;
			case 2:
				System.out.println("请输入用户名");
				String user = sc .next();
				System.out.println("请输入密码");
				String pass = sc .next(); 	
				if(username.equals(user)&& password.equals(pass)) {
					System.out.println("登录成功");
				}
				else {
					System.out.println("登录失败");
				}
				break;
			}			if(x == 3) {
				break;
			}
		    	System.out.println("退出成功");
		    }
	}
}
